package com.yystar.user.operator.web;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import com.yystar.user.operator.domain.Operator;

public class AuthenticationInterceptor extends HandlerInterceptorAdapter {
	private static final Log log = LogFactory.getLog("authenticationInterceptor");
	private List<String> ignoreURLs;
	private String loginURL = "/WEB-INF/views/logout.jsp";
	private String logout_ajax = "/WEB-INF/views/logout_ajax.jsp";
	private String accessDeniedURL = "/WEB-INF/views/access_denied.jsp";
	private String sessionInvalidURL = "/WEB-INF/views/session_invalid.jsp";
	private static ThreadLocal<Operator> session = new ThreadLocal<Operator>();

	public static Operator getOperator() {
		return session.get();
	}

	public static String getOperatorCode() {
		Operator operator = getOperator();
		return operator == null ? null : operator.getOpLoginCode();
	}
	
}
